#include <stdio.h>
#include <math.h>
#define v 340
#define la 97.304
#define lo 111.263


void count_r(double* px, double* py, double* pz, double* pt, double* pr)
{
	int i = 0;
	for (i = 0; i < 7; i++)
	{
		double R = pow(px[i]*la, 2) + pow(py[i]*lo, 2) + pow(pz[i], 2);
		pr[i] = sqrt(R);
	}
}

void count_s(double* pt, double* ps)
{
	for (int i = 0; i < 7; i++)
		ps[i] = pt[i] * v/3.6;
}

void Print(double* pr)
{
	for (int i = 0; i < 7; i++)
	{
		printf("%lf\n", pr[i]);
	}
}

int main()
{
	double x[7] = { 110.241, 110.780, 110.712, 110.251, 110.524, 110.467, 110.047 };
	double y[7] = { 27.204 ,27.456 ,27.785 ,27.825,27.617, 27.921, 27.121 };
	double z[7] = { 0.824, 0.727, 0.742, 0.850, 0.786, 0.678, 0.575 };
	double t[7] = { 100.767, 112.220, 188.020, 258.985, 118.443, 266.871,163.024 };
	double r[7] = { 0 };
	double s[7] = { 0 };
	count_r(x,y,z,t,r);
	count_s(t,s);
	Print(r);
	printf("\n");
	Print(s);
	return 0;
}